/* 重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
}

body {
    background: #0a0a16;
    color: #00ffea;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 霓虹线条装饰 */
.neon-line {
    position: fixed;
    background: linear-gradient(90deg, 
        transparent, 
        #00ffea, 
        transparent);
    z-index: 9999;
    filter: blur(1px);
    box-shadow: 0 0 15px #00ffea,
                0 0 30px #00ffea;
}

.neon-line.horizontal {
    width: 100%;
    height: 2px;
}

.neon-line.vertical {
    height: 100%;
    width: 2px;
}

.neon-line.top {
    top: 0;
    animation: slideRight 20s linear infinite;
}

.neon-line.bottom {
    bottom: 0;
    animation: slideLeft 20s linear infinite;
}

.neon-line.left {
    left: 0;
    animation: slideDown 20s linear infinite;
}

.neon-line.right {
    right: 0;
    animation: slideUp 20s linear infinite;
}

@keyframes slideRight {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

@keyframes slideLeft {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@keyframes slideDown {
    0% { background-position: 0 -100%; }
    100% { background-position: 0 100%; }
}

@keyframes slideUp {
    0% { background-position: 0 100%; }
    100% { background-position: 0 -100%; }
}

/* 扫描线效果 */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 255, 234, 0.03) 50%
    );
    background-size: 100% 4px;
    z-index: 9998;
    pointer-events: none;
    animation: scan 8s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* 网格布局 */
.cyber-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 20px;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 玩家区域 */
.player-section {
    background: rgba(10, 15, 35, 0.85);
    border: 1px solid rgba(0, 255, 234, 0.3);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.player-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #00ffea, #0080ff, #ff00ff, #00ffea);
    border-radius: 12px;
    z-index: -1;
    filter: blur(10px);
    opacity: 0.5;
}

/* 霓虹标题 */
.neon-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.neon-title span {
    display: inline-block;
    margin: 0 10px;
}

.neon-title span:nth-child(1) {
    color: #00ffea;
    text-shadow: 0 0 10px #00ffea,
                 0 0 20px #00ffea,
                 0 0 40px #00ffea;
}

.neon-title span:nth-child(2) {
    color: #ff00ff;
    font-size: 3.5rem;
    text-shadow: 0 0 10px #ff00ff,
                 0 0 20px #ff00ff;
}

.neon-title span:nth-child(3) {
    color: #0080ff;
    text-shadow: 0 0 10px #0080ff,
                 0 0 20px #0080ff;
}

.neon-flicker {
    animation: flicker 3s infinite alternate;
}

@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 10px currentColor,
                     0 0 20px currentColor,
                     0 0 40px currentColor;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* 霓虹文本 */
.neon-text {
    text-shadow: 0 0 5px currentColor,
                 0 0 10px currentColor;
}

.neon-text.blue {
    color: #00ffea;
}

.neon-text.pink {
    color: #ff00ff;
}

/* 玩家头部 */
.cyber-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 255, 234, 0.3);
}

.cyber-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 255, 234, 0.1);
    border: 1px solid #00ffea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #00ffea;
}

.cyber-level {
    margin-left: auto;
    padding: 4px 12px;
    background: rgba(255, 0, 255, 0.2);
    border: 1px solid #ff00ff;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #ff00ff;
}

/* 牌显示区域 */
.cards-display {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    min-height: 160px;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 234, 0.2);
}

/* 卡牌样式 */
.card {
    width: 90px;
    height: 126px;
    border-radius: 8px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-10px) rotateX(10deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.card-front {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    color: white;
    transform: rotateY(0deg);
}

.card-back {
    background: linear-gradient(145deg, #ff00ff, #0080ff);
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
    animation: spin 10s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-top, .card-bottom {
    font-size: 1.2rem;
    font-weight: bold;
}

.card-bottom {
    transform: rotate(180deg);
    align-self: flex-end;
}

.card-center {
    font-size: 2.5rem;
    text-align: center;
    margin: auto;
}

.heart, .diamond {
    color: #ff3860;
    text-shadow: 0 0 5px #ff3860;
}

.spade, .club {
    color: #00ffea;
    text-shadow: 0 0 5px #00ffea;
}

/* 状态面板 */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 234, 0.2);
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #8a8aff;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ffea;
    text-shadow: 0 0 10px #00ffea;
}

/* 中央面板 */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-title {
    text-align: center;
    padding: 20px;
    background: rgba(10, 15, 35, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.subtitle {
    color: #8a8aff;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 5px;
}

/* 信息网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.cyber-card {
    background: rgba(10, 15, 35, 0.8);
    border: 1px solid rgba(0, 255, 234, 0.3);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.cyber-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 234, 0.2);
    border-color: #00ffea;
}

.cyber-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00ffea;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.deck-progress {
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00ffea, #0080ff);
    width: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff3860;
    display: inline-block;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

.status-indicator.active {
    background: #00ff9d;
    box-shadow: 0 0 10px #00ff9d;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 控制面板 */
.control-panel {
    background: rgba(10, 15, 35, 0.9);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(0, 255, 234, 0.3);
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.cyber-btn {
    position: relative;
    background: transparent;
    border: none;
    color: white;
    padding: 20px 10px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 255, 234, 0.1), 
        rgba(255, 0, 255, 0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.cyber-btn:hover::before {
    opacity: 1;
}

.cyber-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #00ffea, #0080ff, #ff00ff, #00ffea);
    border-radius: 10px;
    z-index: -2;
    filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s;
}

.cyber-btn:hover::after {
    opacity: 1;
}

.cyber-btn .btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cyber-btn i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.cyber-btn .btn-hint {
    font-size: 0.7rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hit-btn { border: 1px solid #00ffea; color: #00ffea; }
.stand-btn { border: 1px solid #ff3860; color: #ff3860; }
.deal-btn { border: 1px solid #0080ff; color: #0080ff; }
.newgame-btn { border: 1px solid #ff00ff; color: #ff00ff; }

.hit-btn:hover { background: rgba(0, 255, 234, 0.1); }
.stand-btn:hover { background: rgba(255, 56, 96, 0.1); }
.deal-btn:hover { background: rgba(0, 128, 255, 0.1); }
.newgame-btn:hover { background: rgba(255, 0, 255, 0.1); }

/* 消息面板 */
.message-panel {
    background: rgba(10, 15, 35, 0.9);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(0, 255, 234, 0.3);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00ffea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 234, 0.3);
}

.terminal-blink {
    width: 10px;
    height: 20px;
    background: #00ffea;
    margin-left: auto;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.message-content {
    font-size: 1.1rem;
    line-height: 1.5;
    min-height: 80px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 255, 234, 0.1);
}

.result-display {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, 
        rgba(0, 255, 234, 0.1), 
        rgba(255, 0, 255, 0.1));
    border-radius: 5px;
    border: 1px solid rgba(255, 0, 255, 0.3);
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

/* AI玩家区域 */
.ai-players {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.ai-player {
    background: rgba(20, 25, 45, 0.8);
    border: 1px solid rgba(255, 0, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.2);
}

.ai-name {
    color: #ff00ff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-points {
    color: #00ffea;
    font-size: 0.9rem;
}

.ai-cards {
    min-height: 120px;
    padding: 15px;
}

.ai-status {
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #8a8aff;
    border: 1px solid rgba(138, 138, 255, 0.2);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .cyber-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .player-section {
        min-height: 300px;
    }
    
    .center-panel {
        order: 1;
    }
    
    .player-human {
        order: 2;
    }
    
    .computer-section {
        order: 3;
    }
}

@media (max-width: 768px) {
    .cyber-grid {
        padding: 10px;
        gap: 10px;
    }
    
    .control-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        width: 70px;
        height: 98px;
    }
    
    .neon-title {
        font-size: 1.8rem;
    }
    
    .neon-title span:nth-child(2) {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .stats-panel {
        grid-template-columns: 1fr;
    }
    
    .ai-players {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .ai-player {
        flex: 1 1 calc(50% - 10px);
    }
}

/* 禁用状态 */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:disabled:hover {
    transform: none;
    box-shadow: none;
}

button:disabled::before,
button:disabled::after {
    display: none;
}